package edu.harvard.s3xyback.GUIPractice;

/**
 * Created with IntelliJ IDEA.
 * User: Ryan
 * Date: 11/29/12
 * Time: 3:31 PM
 * To change this template use File | Settings | File Templates.
 */
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;

public class PWindow extends JFrame
{
    public PWindow(String windowType, String html)
    {
        this.setTitle("S3xy Back");
        this.setSize(800, 600);
        this.setLocation(200, 50);

        Container content = this.getContentPane();
        content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));


        JLabel label = new JLabel(html);
        label.setFont(new Font("Arial", Font.PLAIN,20));
        label.setAlignmentX(0.5f);


        JButton b1 = new JButton("Close");
        b1.setVerticalTextPosition(AbstractButton.CENTER);
        b1.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales
        b1.setMnemonic(KeyEvent.VK_D);
        b1.setActionCommand("close");

        content.add(Box.createVerticalStrut(100));
        content.add(label);

        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        this.setVisible(true);
    }
}
